package com.dcits.cn.controller;


import com.dcits.cn.entity.User;
import com.dcits.cn.service.TestService;
import io.qameta.allure.*;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;


/**
 * @Description：
 * @ClassName：TestController
 * @Author:Mryu7
 * @Date:2022/9/2617:59
 */

@SpringBootTest
@Epic("测试模块1")
@Feature("someTest")
public class SomeTest3 {


    @Autowired
    private TestService testService;

    @Story("是否获得用户信息")
    @Test
    public void test1() {

        User user1 = testService.returnUser();


        Assertions.assertNotNull(user1);
//           Assertions.assertNull(user1);
        System.out.println("这是单元测试");
        System.out.println("测试报告生成");
        System.out.println("junit5测试");
        //test auto maven
    }
    @Description("详细描述测试用例2")
    @Test
    @Severity(SeverityLevel.NORMAL)
    public void test2() {
        //测试
        System.out.println("执行test2");

        int a = 3;
        int b = 2;
        int c = 1;

        Assertions.assertTrue(a-b>c);

    }
    @Link("www.baidu.com")
    @Test
    public void test3() {

        Assertions.assertEquals(1,5);
        int [] arr1 = {1,3,5,7,9};
        int [] arr2 = {2,4,6,8,10};
        int [] arr3 = {2,4,6,8,10};
        Assertions.assertArrayEquals(arr1,arr2);
        Assertions.assertArrayEquals(arr2,arr3);

        //测试
        System.out.println("执行test3");

    }

}
